<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>云校通-教师-兴趣课堂</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
<body ontouchstart style="backgroup: #fff;">
	<div class="weui_tab tab-bottom">
		<%-- <div class="weui-header bg-blue"> 
	  		<div class="weui-header-left"> <a href="<%=basePath %>/xs" class="icon icon-109 f-white">返回</a> </div>
	    	<h1 class="weui-header-title">兴趣课堂</h1>
	    </div> --%>
	    <div class="page-bd">
	      <ul>
	        <li style="margin-bottom: 0; border-bottom: 1px solid #e7dede;">
	            <div class="weui-header weui-flex w_title js-category">
	              <div class="weui-header-left">
	                <a href="<%=basePath %>/xs?sid=${user.parent.studentId}" class="icon icon-109">返回</a>
	              </div>
	              <p class="weui-header-title">${term.termName }</p>
	            </div>
	        </li>
	      </ul>
	    </div>
		<div class="weui_tab_bd">
       		<div class="weui_panel_bd" style="margin-bottom: 55px;">
       			<div class="bg-f8 f-14 p10 f-red hide">
       				亲爱的家长，一个学期只有两次调班机会哦，请谨慎申请，谢谢您的支持!
       			</div>
                <div class="weui_media_box weui_media_small_appmsg" >
                 	<c:forEach var="itm" items="${list }">
                  		<div class="weui_cells weui_cells_1">
              				<div class="weui_cell">							
              					<div class="weui_cell_bd weui_cell_primary">								
              						<p>${itm.studentName }</p>							
              					</div>
              					<c:if test="${itm.courseId != null }">
	              					<div class="weui_cell_ft hide">
	              						<a href="<%=basePath %>/xs/interest/course/list?sid=${user.parent.studentId }&xbsid=${itm.studentId}&xboid=${itm.courseId}"><span class="icon icon-99 f20"></span>调班</a>							
	              					</div>
              					</c:if>						
              				</div>						
              				<div class="weui_cell xkpt-lesson">							
              					<div class="weui_cell_bd weui_cell_primary">								
              						<p>课程名称</p>							
              					</div>
              					<c:choose>
              						<c:when test="${itm.courseId == null }">
              							<div class="f-red">暂无</div>
              						</c:when>
              						<c:otherwise>
              							<div class="weui_cell_ft">${itm.courseName }</div>
              						</c:otherwise>
              					</c:choose>							
              				</div>
              			</div>
                	</c:forEach>
            	</div>
            	<div class="weui_cell lblue tz-history-title hide" style="background-color: #fff;">
		            <div class="weui_cell_bd weui_cell_primary">
		                <p class="bold pr">小孩调班申请</p>
		            </div>
		        </div>
		        <div class="weui_media_box weui_media_small_appmsg hide" id="reqList">
		        
		        </div>
			</div>
		</div>
	</div>
</body>
<jsp:include page="/WEB-INF/page/common/_footer.jsp"></jsp:include>
<script type="text/javascript">
$(function() {
	//loadChangeClassReq();
})
function loadChangeClassReq() {
	$.ajax({
      	url : basePath + "/xs/interest/course/changeClass/req",
 		type : "post",
 		dataType : "json",
        success: function(data){
        	if(data != null) {
        		var html = '';
        		for(var i in data) {
        			var itm = data[i];
        			if(itm.status != '001') {
        				html += '<div class="weui_cells weui_cells_1">\
									<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>'+itm.studentName+'</p>\
								</div>\
								<div class="weui_cell_ft">\
									<img style="width: 60px" src="<%=basePath%>/images/'+(itm.status == '000' ? 'shenpitongguo.png' : 'shenpibohui.png')+'">\
								</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>新选报课程</p>\
								</div>\
								<div class="weui_cell_ft">'+itm.newCourseName+'</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>原选报课程</p>\
								</div>\
								<div class="weui_cell_ft">'+itm.oldCourseName+'</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>审批时间</p>\
								</div>\
								<div class="weui_cell_ft">'+getTime(itm.updateTime,'yyyy-MM-dd hh:mm')+'</div>\
							</div>';
							if(itm.status == '002') {
								html += '<div class="weui_cell">\
												<div class="weui_cell_bd weui_cell_primary"><p>驳回原因：</p></div>\
											</div>\
											<div class="weui_cell_1 weui_cell">\
												<p class="f15">'+itm.rejectReason+'</p>\
											</div>\
										</div>';
							}
						html += '</div>';	
					}else {
						html += '<div class="weui_cells weui_cells_1">\
									<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>'+itm.studentName+'</p>\
								</div>\
								<div class="weui_cell_ft">\
									<img style="width: 60px" src="<%=basePath%>/images/daish.png">\
								</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>已报课程</p>\
								</div>\
								<div class="weui_cell_ft">'+itm.oldCourseName+'</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>申请课程</p>\
								</div>\
								<div class="weui_cell_ft">'+data[i].newCourseName+'</div>\
							</div>\
							<div class="weui_cell">\
								<div class="weui_cell_bd weui_cell_primary">\
									<p>申请时间</p>\
								</div>\
								<div class="weui_cell_ft">'+getTime(itm.createTime,'yyyy-MM-dd hh:mm')+'</div>\
							</div>\
						</div>';
					}
        		}
        		$("#reqList").html(html);
        	}
        },
        error: function(xhr, type){
        }
     });
}
</script>
</html>